﻿using Wips.Domain.Events;

namespace Wips.Domain.Models
{
    /// <summary>
    /// 执行日志
    /// </summary>
    [SugarTable("publish_log")]
    public class PublishLog : ValueObjectBase
    {
        /// <summary>
        /// 
        /// </summary>
        public PublishLog() { }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="event"></param>
        public PublishLog(AddPublishLogEvent @event) {

            this.NodeType = @event.NodeType;
            this.Context = @event.Context;
            this.Key = @event.Key;
            this.UserId = @event.UserId;
            this.Result = @event.Result;

        }

        /// <summary>
        /// 节点类型
        /// </summary>
        public EnumNodeType NodeType { get; set; }


        /// <summary>
        /// 执行的结果
        /// </summary>
        [SqlSugar.SugarColumn(ColumnDataType = "varchar(max)")]
        public string? Result { get; set; } = "";

        /// <summary>
        /// 执行的内容
        /// </summary>
        [SqlSugar.SugarColumn(ColumnDataType = "varchar(max)")]
        public string? Context { get; set; } = "";


        /// <summary>
        /// 谁执行的
        /// </summary>
        public string? UserId { get; set; }



        /// <summary>
        /// 主键
        /// </summary>
        public string? Key { get; set; }

    }
}
